<template>
  <div>
    <div>
      <van-cell
        :title="partner.name"
        :label="partner.title__name"
        :icon="partner.image"
        is-link
        @click.native="onClick"
      />

      <van-cell
        title="设置在线咨询问诊费"
        label=""
        icon="gold-coin-o"
        is-link
        to="/user/setfee"
        :value="sotl.price_unit"
      />

      <van-cell
        title="我的钱包"
        label=""
        icon="balance-list-o"
        is-link
        :value="-partnerledger.balance"
      />

      <van-cell
        title="历史挂号单"
        label=""
        icon="balance-list-o"
        is-link
        to="/so/solist"
      />

      <div>
        <!-- {{ partner }} -->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'MeConsultant',
  components: {},
  directives: {},
  filters: {},
  // mixins: [],
  props: {
    // title: { type: String, default: '我的' }
  },

  data() {
    return {
      title: '我的',
      sotl: {}
    }
  },
  computed: {
    partner: function() {
      return this.$store.state.user.partner
    },
    partner_id: function() {
      return this.$store.state.user.partner_id
    },
    partnerledger: function() {
      return this.$store.state.ReportPartnerLedger.dataDict
    }
  },
  async created() {
    //
    console.log('ResPartnerEmp')
    this.getConsultFeeStandard()
    this.getMyPay()
  },

  methods: {
    async getMyPay() {
      //
      const res = await this.$store.dispatch(
        'ReportPartnerLedger/report_print',
        {
          result_selection: 'supplier',
          partner_id: this.partner_id
        }
      )
      console.log('getMyPay', res)
    },

    async getConsultFeeStandard() {
      await this.$store.dispatch('ResPartnerEmp/browse_one', {
        id: this.partner_id
      })
      const sotls = this.$store.state.ResPartnerEmp.dataDict
        .sale_order_template_id__object.sale_order_template_line_ids__objects
      console.log('sot', sotls)

      this.sotl = sotls.length ? sotls[0] : {}
      // this.form = { id: this.partner_id, sale_order_template_id: sot }
    },

    onClick(item) {
      console.log('xxx, click item,', item)
    }
  }
}
</script>

<style type="text/css"></style>
